package guowenlong.golf.ui.personal;


import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.OnClick;
import butterknife.Unbinder;
import de.hdodenhof.circleimageview.CircleImageView;
import guowenlong.golf.R;
import guowenlong.golf.base.BaseFragment;
import guowenlong.golf.ui.login.LoginActivity;
import guowenlong.golf.ui.personal.achievement.AchievementActivity;
import guowenlong.golf.ui.personal.history.HistroryActivity;
import guowenlong.golf.ui.personal.info.PersonalInfomationActivity;
import guowenlong.golf.ui.personal.myclub.MyClubActivity;
import guowenlong.golf.ui.personal.myteam.MyTeamActivity;
import guowenlong.golf.ui.personal.setting.SettingActivity;
import me.wenlong.mixutils.util.SpUtil;

/**
 * des   : 描述 author: Administrator email : guowenlong20000@gmail.com time  : 2017年02月10日 下午 3:19.
 */

public class PersonalFragment extends BaseFragment {

  @BindView(R.id.btn_qr)
  Button btnQr;
  @BindView(R.id.ll_userinfo)
  LinearLayout llUserInfo;
  @BindView(R.id.ll_history)
  LinearLayout llHistory;
  @BindView(R.id.ll_myteam)
  LinearLayout llMyteam;
  @BindView(R.id.ll_myclub)
  LinearLayout llMyclub;
  @BindView(R.id.ll_setting)
  LinearLayout llSetting;
  @BindView(R.id.ll_safe)
  LinearLayout llSafe;
  @BindView(R.id.civ_userhead)
  CircleImageView civUserhead;
  @BindView(R.id.ll_vip)
  LinearLayout llVip;
  @BindView(R.id.ll_achievement)
  TextView llAchievement;
  @BindView(R.id.btn_logout)
  Button btnLogout;
  Unbinder unbinder;

  @Override
  public void initData(Bundle savedInstanceState) {

  }

  @Override
  public void initView() {

  }

  @Override
  public int getLayoutId() {
    return R.layout.fragment_personal;
  }

  @OnClick({R.id.btn_qr, R.id.ll_userinfo, R.id.ll_achievement, R.id.ll_history, R.id.ll_setting,
      R.id.ll_myteam, R.id.ll_myclub, R.id.ll_safe, R.id.btn_logout,R.id.ll_vip})
  public void onClick(View view) {
    switch (view.getId()) {
      case R.id.btn_qr:
        break;
      case R.id.ll_setting:
        startActivity(new Intent(getActivity(), SettingActivity.class));
        break;
      case R.id.ll_history:
        startActivity(new Intent(getActivity(), HistroryActivity.class));
        break;
      case R.id.ll_userinfo:
        startActivity(new Intent(getActivity(), PersonalInfomationActivity.class));
        break;
      case R.id.ll_achievement:
        startActivity(new Intent(getActivity(), AchievementActivity.class));
        break;
      case R.id.ll_myclub:
        startActivity(new Intent(getActivity(), MyClubActivity.class));
        break;
      case R.id.ll_safe:
        startActivity(new Intent(getActivity(), SafeActivity.class));
        break;
      case R.id.ll_myteam:
        startActivity(new Intent(getActivity(), MyTeamActivity.class));
        break;
      case R.id.btn_logout:
        SpUtil.setUser(null);
        startActivity(new Intent(getActivity(), LoginActivity.class));
        break;
      case R.id.ll_vip:
        startActivity(new Intent(getActivity(), VipActivity.class));
        break;
    }
  }
}